Learn R Programming

rtables (version 0.4.0)

[<-,VTableTree,ANY,ANY,list-method: retrieve and assign elements of a TableTree

Description

retrieve and assign elements of a TableTree

Usage

# S4 method for VTableTree,ANY,ANY,list
[(x, i, j, ...) <- value

# S4 method for VTableTree,ANY,ANY,CellValue [(x, i, j, ...) <- value

# S4 method for VTableTree,logical,logical [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,logical,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,logical,missing [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,ANY,logical [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,ANY,missing [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,missing,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,ANY,character [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,character,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,character,character [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,missing,numeric [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,numeric,numeric [(x, i, j, ..., drop = FALSE)

# S4 method for VTableTree,list [[(x, i, j, ...)

Arguments

x

TableTree

i

index

j

index

Includes

keep_topleft

logical(1) ([ only) Should the 'top-left' material for the table be retained after subsetting. Defaults to NA, which retains the material if all rows are included (ie subsetting was by column), and drops it otherwise.

keep_titles

logical(1) Should title and non-referential footer information be retained. Defaults to FALSE

reindex_refs

logical(1). Should referential footnotes be re-indexed as if the resulting subset is the entire table. Defaults to TRUE

value

Replacement value (list, TableRow, or TableTree)

drop

logical(1). Should the value in the cell be returned if only one cell is selected by the combination of i and j. Defaults to FALSE

Value

a TableTree (or ElementaryTable) object, unless a single cell was selected with drop=TRUE, in which case the (possibly multi-valued) fully stripped raw value of the selected cell.

Examples

Run this code
# NOT RUN {
l <- basic_table() %>%
   split_cols_by("ARM") %>%
   analyze(c("SEX", "AGE"))

tbl <- build_table(l, DM)

tbl

tbl[1, ]
tbl[1:2, 2]

tbl[2, 1]
tbl[2, 1, drop = TRUE]

tbl[, 1]

tbl[-2, ]
tbl[, -1]

tbl[2, 1] <- rcell(999)
tbl[2, ] <- list(rrow("FFF", 888, 666, 777))
tbl[3, ] <- list(-111, -222, -333)
tbl
# }

Run the code above in your browser using DataLab